import time
import unittest
from selenium import webdriver


class TestABC(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()
        self.driver.implicitly_wait(30)

    def test_ui1(self):
        self._test_baidu("王者荣耀")
        time.sleep(3)

    def test_ui2(self):
        self._test_baidu("LOL")
        time.sleep(3)

    def _test_baidu(self, searchWord):
        self.driver.get("https://www.baidu.com")
        self.driver.find_element_by_id("kw").send_keys(searchWord)
        self.driver.find_element_by_id("su").click()

    def tearDown(self):
        self.driver.quit()
